#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <map.h>
#include <QTimer>
#include "main_plane.h"
#include <QLabel>
#include <list>
#include "bad_plane1.h"
#include <QProgressBar>

using std::list;

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void paintEvent(QPaintEvent *event)override;
    void keyPressEvent(QKeyEvent *event) override;
    void keyReleaseEvent(QKeyEvent *event) override;
    void paint_bullet(QPainter &p);
    void add_bad_plane();
    void move_bad_plane(QPainter &p);
    void QRect_detection();
    void restart();
    void set_bar(QPainter &p);
    void set_scores(QPainter &p);
    void get_reward();

private slots:
    void onTimerTimeout();


private:
    Ui::MainWindow *ui;
    map *m;
    QTimer *timer;
    main_plane *hero;
    list<bad_plane1> bad_p1;
    int get_bad_p;
    QProgressBar *life_bar;
    int scores;
    int lever;

private:
    int k_up;
    int k_down;
    int k_right;
    int k_left;


};
#endif // MAINWINDOW_H
